package javatest3.ForWhileTest.test2;

import java.util.Scanner;
/*
找出2到999之间所有素数
 */

public class method2 {
    public static void main(String[] args) {
        int n,j=0;

        for (n = 2; n < 999; n++) {
            boolean flag = true;
            for (int i = 2; i < n; i++) {
                if ((n % i) == 0) {
                    flag = false;
                    break;
                }
            }

            if (flag) {
                j++;
                System.out.print(n+"\t\t");
               if (j%5==0){
                    System.out.println();
                }
            }
        }
    }
}





